package logic.util;

import logic.bean.BookBean;
import logic.constants.DefaultConsts;

import android.content.Context;
import android.content.Intent;

public class BroadcastUtil {
    /**
     * 发送最近阅读数据改变的通知
     *
     * @param context
     * @param flag
     */
    public static void booksDataChange(Context context, int flag, BookBean bean) {
        Intent intent = new Intent(DefaultConsts.BOOKSHELF_DATA_CHANGE_BROADCAST);
        intent.putExtra("packageName", AppUtils.getPackageName(context));
        intent.putExtra("flag", flag);
        if (null != bean) {
            intent.putExtra("BookBean", bean);
        }
        context.sendBroadcast(intent);
    }
}
